<!--
  @author heguanghua
  @since 2019/06/12 11:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss2"/>
<style>
    .operator-panel .layui-btn{
        width: 100px;
    }
</style>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        渠道管理>
        <a lay-href="/channel/list.action">渠道管理</a>
    </blockquote>

    <div class="layui-card">

        <form method="POST" class="layui-form" action="/channel/list.action">
            <div th:replace="channel/_query::query"></div>
        </form>

        <div class="layui-card-body">

            <div th:replace="channel/_table::table"></div>

            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/updateStatus.action')}">
                        <button class="layui-btn layui-btn-sm" lay-event="start">启用</button>
                        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="stop">停用</button>
                    </div>
                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/add.action')}">
                        <a lay-href="/channel/detailOne.action?addFlag=1" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="新建一级渠道">+新建一级渠道</a>
                    </div>
                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/add.action')}">
                        <a lay-href="/channel/detailTwo.action?addFlag=1" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="新建二级渠道">+新建二级渠道</a>
                    </div>
                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/copyChannel.action')}">
                        <a lay-href="/channel/copyChannel.action?" class="layui-btn layui-btn-sm layui-btn-primary">复制渠道信息</a>
                    </div>
                </div>
            </script>

        </div>

    </div>

</div>
</body>
</html>

<script id="configInnerNameHtml" type="text/html">
    <form method="POST" action="" class="layui-form" lay-filter="zmn-form">
        <input type="hidden" name="channelId" value="{{d.channelId}}"/>
        <div class="layui-form-item"></div>
        <div class="layui-form-item">
            <label class="layui-form-label">渠道名称：</label>
            <div class="layui-input-inline" style="width:250px">
                <input type="text" value="{{d.name}}" class="layui-input" disabled/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">内部名称：</label>
            <div class="layui-input-inline" style="width:250px">
                <input type="text" name="innerName" value="{{d.innerName == '--' ? '' : d.innerName}}" placeholder="" lay-verify="" lay-verType="tips" autocomplete="off" class="layui-input" maxlength="50"/>
            </div>
        </div>
        <div class="layui-form-item submit">
            <div style="text-align: center">
                <button class="layui-btn" lay-submit lay-filter="zmn-form-submit">提交</button>
                <a class="layui-btn layui-btn-primary" onclick="layer.close(childIndex);">取消</a>
            </div>
        </div>
    </form>
</script>

<script type="text/javascript" th:inline="javascript">

    var json = {
        totalCount: [[${query.totalCount}]],
        pageSize: [[${query.pageSize}]],
        pageIndex: [[${query.pageIndex}]],
        provinces: [[${provinces}]],
        citys: [[${citys}]],
        provinceId: [[${query.provinceId}]],
        cityId: [[${query.cityId}]],
        plats: [[${plats}]],
        oneDepts: [[${oneDepts}]],
        twoDepts: [[${twoDepts}]],
        obj: [[${query}]],
        oneChannels: [[${oneChannels}]],
        faultTariffs: [[${faultTariffs}]],
        hasViewInPrice: [[${#authPermit.checkPermit('/channel/inPriceList.action')}]],
        hasViewOutPrice: [[${#authPermit.checkPermit('/channel/outPriceList.action')}]],
        hasViewProjectPrice: [[${#authPermit.checkPermit('/channel/projectPriceList.action')}]],
        hasViewSettle: [[${#authPermit.checkPermit('/channel/settle/addEditView.action')}]],
        hasViewEdit: [[${#authPermit.checkPermit('/channel/addEditView.action')}]],
        hasViewConfigInnerName: [[${#authPermit.checkPermit('/channel/configInnerName.action')}]],

        hasExportExcel: [[${#authPermit.checkPermit('/channel/outputExcel.action')}]],
        SYS_MCC: [[${SYS_MCC}]],
        query: [[${query}]],
    };

    layui.config({
        base: "/static/lay/",
        version: 202009161722
    }).extend({
        index: "lib/index",
        formSelects: '{/}/static/lay/layui/formSelects-v4',
        channel_list: "channel/zmn.plat.channel.list",
    }).use(['index', 'channel_list']);

</script>
